3.1.80 \(\int \frac {(d+e x) (a+b \log (c x^n))^2}{x^2} \, dx\) [80]

Optimal. Leaf size=72 \[ -\frac {2 b^2 d n^2}{x}-\frac {2 b d n \left (a+b \log \left (c x^n\right )\right )}{x}-\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{x}+\frac {e \left (a+b \log \left (c x^n\right )\right )^3}{3 b n} \]

[Out]

-2*b^2*d*n^2/x-2*b*d*n*(a+b*ln(c*x^n))/x-d*(a+b*ln(c*x^n))^2/x+1/3*e*(a+b*ln(c*x^n))^3/b/n

________________________________________________________________________________________

Rubi [A]
time = 0.09, antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {2395, 2342, 2341, 2339, 30} \begin {gather*} -\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{x}-\frac {2 b d n \left (a+b \log \left (c x^n\right )\right )}{x}+\frac {e \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}-\frac {2 b^2 d n^2}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((d + e*x)*(a + b*Log[c*x^n])^2)/x^2,x]

[Out]

(-2*b^2*d*n^2)/x - (2*b*d*n*(a + b*Log[c*x^n]))/x - (d*(a + b*Log[c*x^n])^2)/x + (e*(a + b*Log[c*x^n])^3)/(3*b
*n)

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2339

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/(x_), x_Symbol] :> Dist[1/(b*n), Subst[Int[x^p, x], x, a + b*L
og[c*x^n]], x] /; FreeQ[{a, b, c, n, p}, x]

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 1)), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rule 2395

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol]
:> With[{u = ExpandIntegrand[(a + b*Log[c*x^n])^p, (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[
{a, b, c, d, e, f, m, n, p, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0] && IntegerQ[m] && IntegerQ[r
]))

Rubi steps

\begin {align*} \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx &=\int \left (\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{x^2}+\frac {e \left (a+b \log \left (c x^n\right )\right )^2}{x}\right ) \, dx\\ &=d \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx+e \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{x} \, dx\\ &=-\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{x}+\frac {e \text {Subst}\left (\int x^2 \, dx,x,a+b \log \left (c x^n\right )\right )}{b n}+(2 b d n) \int \frac {a+b \log \left (c x^n\right )}{x^2} \, dx\\ &=-\frac {2 b^2 d n^2}{x}-\frac {2 b d n \left (a+b \log \left (c x^n\right )\right )}{x}-\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{x}+\frac {e \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 63, normalized size = 0.88 \begin {gather*} -\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{x}+\frac {e \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}-\frac {2 b d n \left (a+b n+b \log \left (c x^n\right )\right )}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((d + e*x)*(a + b*Log[c*x^n])^2)/x^2,x]

[Out]

-((d*(a + b*Log[c*x^n])^2)/x) + (e*(a + b*Log[c*x^n])^3)/(3*b*n) - (2*b*d*n*(a + b*n + b*Log[c*x^n]))/x

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.18, size = 1544, normalized size = 21.44

method result size
risch \(\text {Expression too large to display}\) \(1544\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x+d)*(a+b*ln(c*x^n))^2/x^2,x,method=_RETURNVERBOSE)

[Out]

-b^2*(-e*x*ln(x)+d)/x*ln(x^n)^2-b*(I*ln(x)*Pi*b*e*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)*x-I*ln(x)*Pi*b*e*csgn(I*
c)*csgn(I*c*x^n)^2*x-I*ln(x)*Pi*b*e*csgn(I*x^n)*csgn(I*c*x^n)^2*x+I*ln(x)*Pi*b*e*csgn(I*c*x^n)^3*x-I*Pi*b*d*cs
gn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)+I*Pi*b*d*csgn(I*c)*csgn(I*c*x^n)^2+I*Pi*b*d*csgn(I*x^n)*csgn(I*c*x^n)^2-I*Pi
*b*d*csgn(I*c*x^n)^3+b*e*n*ln(x)^2*x-2*ln(x)*ln(c)*b*e*x-2*ln(x)*a*e*x+2*d*b*ln(c)+2*b*d*n+2*a*d)/x*ln(x^n)+1/
12*(12*I*Pi*b^2*d*n*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)+6*I*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x^n)*csgn(I*c*x^n)*x-12*I*ln(x)*Pi*a*b
*e*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)*x)/x

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 117, normalized size = 1.62 \begin {gather*} \frac {b^{2} e \log \left (c x^{n}\right )^{3}}{3 \, n} - 2 \, b^{2} d {\left (\frac {n^{2}}{x} + \frac {n \log \left (c x^{n}\right )}{x}\right )} - \frac {b^{2} d \log \left (c x^{n}\right )^{2}}{x} + \frac {a b e \log \left (c x^{n}\right )^{2}}{n} + a^{2} e \log \left (x\right ) - \frac {2 \, a b d n}{x} - \frac {2 \, a b d \log \left (c x^{n}\right )}{x} - \frac {a^{2} d}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2/x^2,x, algorithm="maxima")

[Out]

1/3*b^2*e*log(c*x^n)^3/n - 2*b^2*d*(n^2/x + n*log(c*x^n)/x) - b^2*d*log(c*x^n)^2/x + a*b*e*log(c*x^n)^2/n + a^
2*e*log(x) - 2*a*b*d*n/x - 2*a*b*d*log(c*x^n)/x - a^2*d/x

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 155 vs. \(2 (71) = 142\).
time = 0.47, size = 155, normalized size = 2.15 \begin {gather*} \frac {b^{2} n^{2} x e \log \left (x\right )^{3} - 6 \, b^{2} d n^{2} - 3 \, b^{2} d \log \left (c\right )^{2} - 6 \, a b d n - 3 \, a^{2} d + 3 \, {\left (b^{2} n x e \log \left (c\right ) - b^{2} d n^{2} + a b n x e\right )} \log \left (x\right )^{2} - 6 \, {\left (b^{2} d n + a b d\right )} \log \left (c\right ) + 3 \, {\left (b^{2} x e \log \left (c\right )^{2} - 2 \, b^{2} d n^{2} - 2 \, a b d n + a^{2} x e - 2 \, {\left (b^{2} d n - a b x e\right )} \log \left (c\right )\right )} \log \left (x\right )}{3 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2/x^2,x, algorithm="fricas")

[Out]

1/3*(b^2*n^2*x*e*log(x)^3 - 6*b^2*d*n^2 - 3*b^2*d*log(c)^2 - 6*a*b*d*n - 3*a^2*d + 3*(b^2*n*x*e*log(c) - b^2*d
*n^2 + a*b*n*x*e)*log(x)^2 - 6*(b^2*d*n + a*b*d)*log(c) + 3*(b^2*x*e*log(c)^2 - 2*b^2*d*n^2 - 2*a*b*d*n + a^2*
x*e - 2*(b^2*d*n - a*b*x*e)*log(c))*log(x))/x

________________________________________________________________________________________

Sympy [A]
time = 3.22, size = 141, normalized size = 1.96 \begin {gather*} - \frac {a^{2} d}{x} + a^{2} e \log {\left (x \right )} - \frac {2 a b d n}{x} - \frac {2 a b d \log {\left (c x^{n} \right )}}{x} - 2 a b e \left (\begin {cases} - \log {\left (c \right )} \log {\left (x \right )} & \text {for}\: n = 0 \\- \frac {\log {\left (c x^{n} \right )}^{2}}{2 n} & \text {otherwise} \end {cases}\right ) - \frac {2 b^{2} d n^{2}}{x} - \frac {2 b^{2} d n \log {\left (c x^{n} \right )}}{x} - \frac {b^{2} d \log {\left (c x^{n} \right )}^{2}}{x} - b^{2} e \left (\begin {cases} - \log {\left (c \right )}^{2} \log {\left (x \right )} & \text {for}\: n = 0 \\- \frac {\log {\left (c x^{n} \right )}^{3}}{3 n} & \text {otherwise} \end {cases}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*ln(c*x**n))**2/x**2,x)

[Out]

-a**2*d/x + a**2*e*log(x) - 2*a*b*d*n/x - 2*a*b*d*log(c*x**n)/x - 2*a*b*e*Piecewise((-log(c)*log(x), Eq(n, 0))
, (-log(c*x**n)**2/(2*n), True)) - 2*b**2*d*n**2/x - 2*b**2*d*n*log(c*x**n)/x - b**2*d*log(c*x**n)**2/x - b**2
*e*Piecewise((-log(c)**2*log(x), Eq(n, 0)), (-log(c*x**n)**3/(3*n), True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 172 vs. \(2 (71) = 142\).
time = 2.52, size = 172, normalized size = 2.39 \begin {gather*} \frac {b^{2} n^{2} x e \log \left (x\right )^{3} + 3 \, b^{2} n x e \log \left (c\right ) \log \left (x\right )^{2} + 3 \, b^{2} x e \log \left (c\right )^{2} \log \left (x\right ) - 3 \, b^{2} d n^{2} \log \left (x\right )^{2} + 3 \, a b n x e \log \left (x\right )^{2} - 6 \, b^{2} d n^{2} \log \left (x\right ) - 6 \, b^{2} d n \log \left (c\right ) \log \left (x\right ) + 6 \, a b x e \log \left (c\right ) \log \left (x\right ) - 6 \, b^{2} d n^{2} - 6 \, b^{2} d n \log \left (c\right ) - 3 \, b^{2} d \log \left (c\right )^{2} - 6 \, a b d n \log \left (x\right ) + 3 \, a^{2} x e \log \left (x\right ) - 6 \, a b d n - 6 \, a b d \log \left (c\right ) - 3 \, a^{2} d}{3 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2/x^2,x, algorithm="giac")

[Out]

1/3*(b^2*n^2*x*e*log(x)^3 + 3*b^2*n*x*e*log(c)*log(x)^2 + 3*b^2*x*e*log(c)^2*log(x) - 3*b^2*d*n^2*log(x)^2 + 3
*a*b*n*x*e*log(x)^2 - 6*b^2*d*n^2*log(x) - 6*b^2*d*n*log(c)*log(x) + 6*a*b*x*e*log(c)*log(x) - 6*b^2*d*n^2 - 6
*b^2*d*n*log(c) - 3*b^2*d*log(c)^2 - 6*a*b*d*n*log(x) + 3*a^2*x*e*log(x) - 6*a*b*d*n - 6*a*b*d*log(c) - 3*a^2*
d)/x

________________________________________________________________________________________

Mupad [B]
time = 3.73, size = 138, normalized size = 1.92 \begin {gather*} \ln \left (x\right )\,\left (e\,a^2+2\,e\,a\,b\,n+2\,e\,b^2\,n^2\right )-\frac {d\,a^2+2\,d\,a\,b\,n+2\,d\,b^2\,n^2}{x}-{\ln \left (c\,x^n\right )}^2\,\left (\frac {b^2\,d+b^2\,e\,x}{x}-\frac {b\,e\,\left (a+b\,n\right )}{n}\right )-\frac {\ln \left (c\,x^n\right )\,\left (2\,b\,d\,\left (a+b\,n\right )+2\,b\,e\,x\,\left (a+b\,n\right )\right )}{x}+\frac {b^2\,e\,{\ln \left (c\,x^n\right )}^3}{3\,n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((a + b*log(c*x^n))^2*(d + e*x))/x^2,x)

[Out]

log(x)*(a^2*e + 2*b^2*e*n^2 + 2*a*b*e*n) - (a^2*d + 2*b^2*d*n^2 + 2*a*b*d*n)/x - log(c*x^n)^2*((b^2*d + b^2*e*
x)/x - (b*e*(a + b*n))/n) - (log(c*x^n)*(2*b*d*(a + b*n) + 2*b*e*x*(a + b*n)))/x + (b^2*e*log(c*x^n)^3)/(3*n)

________________________________________________________________________________________